<template>
  <div>
    <Province v-if="showProvince" :fileName="fileName" @toMap="toMap"></Province>
    <Map v-else @toProvince="toProvince"></Map>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import Province from './Province.vue'
import Map from './Map.vue'

// 定义组件的状态
const showProvince = ref(false)
const fileName = ref(null)

// 定义方法
const toProvince = ({ fileName: newFileName } = {}) => {
  fileName.value = newFileName
  showProvince.value = true
}

const toMap = () => {
  showProvince.value = false
}
</script>

<style scoped></style>
